package com.example.goods_admin.common;

public class Result {

    //200 400 500 300

    private String code;

    private String message;

    private Object data;

    public Result(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Result(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static Result succeed(String message){
        return new Result("200",message);
    }

    public static Result succeed(String message,Object object){
        return new Result("200",message,object);
    }

    public static Result failed(String message){
        return new Result("500",message);
    }

    public static Result failed(String message,Object object){
        return new Result("500",message,object);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
